//
//  ViewController.m
//  WebViewPopMenu
//
//  Created by GZMLUser on 15-1-8.
//  Copyright (c) 2015年 GZMLUser. All rights reserved.
//

#import "ViewController.h"

#import "webToolbar.h"
@interface ViewController ()<webToolbarDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    WebViewPopmenu *pop = [[WebViewPopmenu alloc]initWithFrame:CGRectMake(CGRectGetWidth(self.view.bounds) / 2 - 20, CGRectGetHeight(self.view.bounds)- 40, 40, 40) items:nil];
//    [self.view addSubview:pop];
    
    ToolbarItem *quitItem = [[ToolbarItem alloc]initWithImage:[UIImage imageNamed:@"commonWebView_quit_web"] highlightImage:[UIImage imageNamed:@"commonWebView_quit_web_hl"]];
    
    
    ToolbarItem *refreshItem = [[ToolbarItem alloc]initWithImage:[UIImage imageNamed:@"commonWebView_refresh_web.png"] highlightImage:[UIImage imageNamed:@"commonWebView_refresh_web_hl.png"]];
    
    NSArray *array = [NSArray arrayWithObjects:quitItem,refreshItem,nil];
    
    
    webToolbar *webtoolbar = [[webToolbar alloc]initWithItems:array frame:CGRectMake(0, CGRectGetHeight(self.view.bounds) - 44, self.view.frame.size.width, 44)];
    webtoolbar.delegate = self;
    [self.view addSubview:webtoolbar];

}


- (void)webToobarItemClicked:(webToolbar *)webtoolbar itemIndex:(NSInteger)itemIndex
{
    NSLog(@"itemIndex:%ld",(long)itemIndex);
}


@end
